/*
 * @Author: Zhilong
 * @Date: 2021-05-15 01:58:43
 * @LastEditTime: 2021-06-24 00:22:15
 * @Description: 
 * @LastEditors: Zhilong
 * @autograph: ⚠ warning!  ⚠ warning!  ⚠ warning!   ⚠野生的页面出现了!!
 */

import KoaRouter from 'koa-router'
import multer from '@koa/multer'
import { resolve } from 'path'
const common  = new KoaRouter()

const upload = multer({
  dest: resolve(__dirname,'../public'), // 储存路径
})

common.post('/uploadImage',upload.single('file'),ctx=>{
  const { req,res } = ctx
  console.log(req,res)
  ctx.body = {
    message:'访问成功'
  }
})

common.get('/show',async (ctx)=>{
  ctx.body = ctx.request.body
})

export default common